package org.adorsys.aderp.aderplogin.security.token;

import org.adorsys.aderp.aderplogin.client.common.Oauth2User;


/**
 * The token replication service.
 * 
 * Memorize token here and share them with trusted clients on request.
 * 
 * For context propagtion, token will be passed to the remote call.
 * 
 * @author francis
 *
 */
public interface Oauth2TokenReplicationService {
	
	/**
	 * Loads the user and returns the user to the client.
	 * 
	 * Keep reference on the client for cleanup.
	 * 
	 * @param token
	 * @param clientId
	 * @return
	 */
	public Oauth2User loadUser(String token, String clientId);
}
